package com.itheima.demo;

import com.itheima.config.SpringConfig;
import com.itheima.pojo.UserInfo;
import com.itheima.service.UserInfoService;
import org.springframework.context.ApplicationContext;
import org.springframework.context.annotation.AnnotationConfigApplicationContext;

public class Demo {
    public static void main(String[] args) {
        ApplicationContext ac = new AnnotationConfigApplicationContext(SpringConfig.class);
        UserInfoService userInfoService = ac.getBean(UserInfoService.class);
        UserInfo userInfo = userInfoService.findById(1);
        System.out.println(userInfo);
    }
}
